package cn.com.sise.service.impl;

import cn.com.sise.dao.FeedbackDao;
import cn.com.sise.pojo.Feedback;
import cn.com.sise.pojo.User;
import cn.com.sise.service.FeedbackService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class FeedbackServiceImpl implements FeedbackService {
    private FeedbackDao feedbackDao;

    @Autowired
    public void setFeedbackDao(FeedbackDao feedbackDao) {
        this.feedbackDao = feedbackDao;
    }

    public int insertFeedback(Feedback feedback) {
        return feedbackDao.insertFeedback(feedback);
    }

    public int deleteFeedback(Feedback feedback) {
        return feedbackDao.deleteFeedback(feedback);
    }

    public int updateFeedback(Feedback feedback) {
        return feedbackDao.updateFeedback(feedback);
    }

    public Feedback selectFeedbackByFeedId(int feedback_id) {
        return feedbackDao.selectFeedbackByFeedId(feedback_id);
    }

    public List<User> selectFeedbackLimit(int i) {
        return feedbackDao.selectFeedbackLimit(i);
    }

    public List<User> selectFeedbackByUsername(String name) {
        return feedbackDao.selectFeedbackByUsername(name);
    }

    public List<Feedback> selectFeedbackByUserID(int user_id, int start, int count) {
        return feedbackDao.selectFeedbackByUserID(user_id, start, count);
    }

    public int getTotalFeedbackByUserID(int user_id) {
        return feedbackDao.getTotalFeedbackByUserID(user_id);
    }

    public int getTimeForFeedback(String time) {
        return feedbackDao.getTimeForFeedback(time);
    }

    public int getFeedbackTotal() {
        return feedbackDao.getFeedbackTotal();
    }

    public List<Feedback> getFeedbackById(int user_id) {
        return feedbackDao.getFeedbackById(user_id);
    }
}
